2

I have a big problem with the language switcher, I have a multi language site that has every article in english and spanish , spanish being the default so if one article is named : domain.com/mi-articulo then the english one will be domain.com/en/my-article (using autopath is creating these aliases) now this works fine if I manualy change the url.. but if I use the language switcher ..the english corespondent it's switches without aliases and Lang prefix so instead of domain.com/en/my-article it finds domain.com/node/47 so as I have the menu and other things translated it makes drupal unaware of the language switched.. here are the screenshots to better understand what's happening (wierd behaviour) ver1. spanish all is in order, menus are ok, language is ok ver2. english with the url like it's suposed to be now if i click on english ..look what happends (see url and content like drupal is not aware that this content is nor spanish nor english...because the language switcher doesn't find the aliases) broken lang switcher content result

apaderno
  • 28,547
  • 16
  • 75
  • 90
PartySoft
  • 2,749
  • 7
  • 39
  • 55

3 Answers3

3

I had the same problem until I set the default 'Language domain' in admin/settings/language/edit/en. Now the module is working as expected.

stealthyninja
  • 10,343
  • 11
  • 51
  • 59
zsd
  • 440
  • 5
  • 17
2

I stumbled upon the same issue today.

All nodes had been imported from another site. All translations were imported, but not the relationship between them, so if you edit a node and check the translations, you may notice that your node doesn't have any given translation.

If this is your issue, you may use the functionality to add existing nodes as translations.

akjoshi
  • 15,374
  • 13
  • 103
  • 121
fyra3or
  • 21
  • 2
0

I have the same problem with the language switcher; just cannot get it to do what it's supposed to do. I ended up effectively writing a very simple version of it by adding a block and inserting the following html:

<ul>
  <li class="first en"><a href="http://www.yoursite.com">English</a></li> 
  <li class="last fr"><a href="http://www.yoursite.com/fr">Français</a></li> 
</ul>

It is limited in that it always takes you back to the homepage after a switch but once that's done, links to other nodes continue correctly with /fr in the url.

Chris Wallis
  • 1,263
  • 8
  • 20